<?php

class SearchController extends Zend_Controller_Action
{
    
    protected $db;
  
    public function init()
    {
        /* Initialize action controller here */
        $this->db=new Application_Model_Database();
        
    }

    public function indexAction()
    {
        // action body
    }

    public function allotAction()
    {
        // action body
      $sql="SELECT a.mag_id, a.mag_folio, a.mag_year, b.mag_cliente, b.mag_numero, a.mag_costo, a.approved, a.open, a.mag_currency, a.mag_iva
        FROM magove_t_folios  as a JOIN magove_t_partes as b ON a.mag_id=b.mag_id AND b.active=1
        GROUP BY a.mag_id
        ORDER BY a.mag_year ASC, a.mag_folio ASC;";
      $rs=$this->db->doQuery($sql);
      if($rs->rowCount()>0)
        $this->view->rs=$rs;
      else
        $this->view->rs=null;
      
    }


}



